<script setup lang="ts">

import type {KeyValue, NumOrString} from "~/types";

  let sourceType=ref<Array<KeyValue>>([
    {value:1,extent:1609344,label:'近期删除域名'},
    {value:2,extent: 37085,label:'纯数字域名还剩'},
    {value:3,extent: 123321,label:'高收录域名还剩'},
    {value:4,extent:123321,label:'高外链域名还剩'},
    {value:5,extent: 123321,label:'高年龄域名还剩'},
    {value:6,extent: 123321,label:'高权重域名还剩'},
    {value:7,extent: 123321,label:'百度高反链还剩'},
    {value:9,extent: 123321,label:'高PR域名还剩'},
  ])
  let currentSourceType=ref<NumOrString>('');
  let newsList=ref<Array<KeyValue>>([
    {value:1,extent:'2024-02-26',label:'参与【任推帮】推广拉新，被动月入参与【任推帮】推广拉新，被动月入...'},
    {value:1,extent:'2024-02-26',label:'参与【任推帮】推广拉新，被动月入...'},
    {value:1,extent:'2024-02-26',label:'参与【任推帮】推广拉新，被动月入...'},
    {value:1,extent:'2024-02-26',label:'参与【任推帮】推广拉新，被动月入...'},
  ])
</script>

<template>
  <div class="domain-source">
    <div class="box-left">
      <div class="flex justify-between p-5 box-header">
        <div class="text-sm box-title">本站资源</div>
        <div class="text-xs">本站已连续10年为 <span class="text-[var(--el-color-primary)]">1000000</span> +用户提供优质域名服务！</div>
      </div>
      <div class="box-list">
        <div v-for="item in sourceType" class="box-list-item">
          <div class="text-base text-black value">{{item.extent}}</div>
          <div class="text-sm text-gray-400 label">{{item.label}}</div>
        </div>
      </div>
    </div>
    <div class="box-right">
      <div class="flex justify-between p-5 box-header">
        <div class="text-sm box-title">新闻公告</div>
        <div class="text-xs hover:text-[var(--el-color-primary)]">更多<span class="icon">&#xe6be;</span></div>
      </div>
      <div class="box-list">
        <div v-for="item in newsList" class="box-list-item">
            <div class="flex justify-between text-sm/8">
              <span class="label">{{ item.label }}</span>
              <span>{{item.extent}}</span>
            </div>
        </div>
      </div>
    </div>
  </div>
</template>

<style scoped lang="scss">
.domain-source{
  display: grid;
  grid-template-columns:700px 440px;
  justify-content: space-between;
  grid-gap:20px;
  width:1160px;
  margin: 10px auto;
}
.box-left{
  background-color: var(--el-color-white);
  .box-list{
    display: grid;
    grid-template-columns: repeat(4,1fr);
    text-align: center;
    padding: 10px;
  }
  .box-list-item{
    &:hover{
      .value{
        color:var(--el-color-primary);
      }
      .label{
        @apply text-black;
      }
    }
    &:nth-of-type(4n+4){
      border-right: none;
    }
    border-right: 1px solid #eeeeee;
    height: 70px;
  }
}
.box-title{
  border-left: 4px solid var(--el-color-primary);
  padding-left: 10px;
}
.box-right{
  background-color: var(--el-color-white);
  .box-list{
    padding: 10px;
  }
  .box-list-item{
    &:first-child{
      color:var(--el-color-error);
    }
    &:nth-child(2){
      color:var(--el-color-primary);
    }
    &:hover{
      padding-left: 10px;
      color:var(--el-color-primary-dark-2);
    }
  }
  .label{
    width: 280px;
    height: 32px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

</style>